//
//  Util.m
//  LessoDemo
//
//  Created by decade on 27/12/2017.
//  Copyright © 2017 Lesso. All rights reserved.
//

#import "Util.h"

@implementation Util

+ (void)showAlertView:(NSString *)msg {
    [Util showAlertView:msg cancelBlock:nil okBlock:nil];
}

+ (void)showAlertView:(NSString *)msg cancelBlock:(cancelBlock)cancelBlock okBlock:(okBlock)okBlock {
    UIAlertController *alertC = [UIAlertController alertControllerWithTitle:msg message:@"" preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:cancelBlock];
    UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:okBlock];
    [alertC addAction:action1];
    [alertC addAction:action2];
    [[appDelegate window].rootViewController presentViewController:alertC animated:YES completion:nil];
}

@end
